namespace ConsoleApp2.input._1023;

public class Student : IDisposable
{
    // public void Deconstruct(out int studentId, out string studentName)
    // {
    //     studentId = studentID;
    //     studentName = this.studentName;
    // }

    private int studentID;
    private string studentName;
    private int studentAge;
    private char studentGender;

    public Student()
    {
    }

    public Student(int studentId, string studentName, int studentAge, char studentGender)
    {
        studentID = studentId;
        this.studentName = studentName;
        this.studentAge = studentAge;
        this.studentGender = studentGender;
    }

    public int StudentId
    {
        get => studentID;
        set => studentID = value;
    }
    public string StudentName
    {
        get => studentName;
        set => studentName = value;
    }
    public int StudentAge
    {
        get => studentAge;
        set => studentAge = value;
    }
    public char StudentGender
    {
        get => studentGender;
        set => studentGender = value;
    }

    public void Test()
    {
        Console.WriteLine("Student ID" );
    }

    public void Dispose()
    {
        Console.WriteLine("Disposed");
    }
}
/**
 * 这是C#中的try-source;
 * 可以打印提示。
 */
class TextDemo
{
    public void TestPrint(){
        using(Student stud = new Student()){
            stud.Test();
        }
    }
}
